/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Login.java
 *
 * Created on 23-oct-2011, 21:28:04
 */
package IGU;

import Comun.SamiFrame;
import IGU.Menu.Menu;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import org.edisoncor.gui.util.WindowDragger;

/**
 *
 * @author luisramirezmartinez
 */
public class Login extends  SamiFrame {

    /** Creates new form Login */
    public Login() {
        initComponents();
        String osnom=System.getProperty("os.name");
          if( osnom.equals("Mac OS X"))
            System.setProperty("apple.laf.useScreenMenuBar", "true");
         
          if( osnom.equals("Mac OS X")){ 
            com.apple.eawt.Application macApp = com.apple.eawt.Application.getApplication();
            macApp.setDockIconImage(new ImageIcon (getClass ().getResource ("/Imagenes/SAMI_App.png")).getImage ());
          }else
           new WindowDragger(this,this.panelRoundTranslucido1);
        
      
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelImage1 = new org.edisoncor.gui.panel.PanelImage();
        panelRoundTranslucido1 = new Comun.PanelRoundTranslucido();
        jTextField1 = new javax.swing.JTextField();
        jPasswordField1 = new javax.swing.JPasswordField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        samiButton1 = new Comun.SamiButton();
        samiButton2 = new Comun.SamiButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        panelImage1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/SAMI_App.png"))); // NOI18N

        org.jdesktop.layout.GroupLayout panelImage1Layout = new org.jdesktop.layout.GroupLayout(panelImage1);
        panelImage1.setLayout(panelImage1Layout);
        panelImage1Layout.setHorizontalGroup(
            panelImage1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 170, Short.MAX_VALUE)
        );
        panelImage1Layout.setVerticalGroup(
            panelImage1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 174, Short.MAX_VALUE)
        );

        getContentPane().add(panelImage1, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 0, -1, -1));

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 18));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Usuario");

        jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 18));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Contraseña");

        samiButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_huella 2.png"))); // NOI18N
        samiButton1.setText("Entrar");
        samiButton1.setMouseEntered(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_huella.png"))); // NOI18N
        samiButton1.setMouseExited(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_huella 2.png"))); // NOI18N
        samiButton1.setMousePressed(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_huella.png"))); // NOI18N
        samiButton1.setMouseReleased(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_huella.png"))); // NOI18N
        samiButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                samiButton1MouseClicked(evt);
            }
        });

        samiButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_shut-down 2.png"))); // NOI18N
        samiButton2.setText("Salir");
        samiButton2.setMouseEntered(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_shut-down.png"))); // NOI18N
        samiButton2.setMouseExited(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_shut-down 2.png"))); // NOI18N
        samiButton2.setMousePressed(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_shut-down.png"))); // NOI18N
        samiButton2.setMouseReleased(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Iconos/SAMI_shut-down.png"))); // NOI18N
        samiButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                samiButton2MouseClicked(evt);
            }
        });

        org.jdesktop.layout.GroupLayout panelRoundTranslucido1Layout = new org.jdesktop.layout.GroupLayout(panelRoundTranslucido1);
        panelRoundTranslucido1.setLayout(panelRoundTranslucido1Layout);
        panelRoundTranslucido1Layout.setHorizontalGroup(
            panelRoundTranslucido1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelRoundTranslucido1Layout.createSequentialGroup()
                .add(44, 44, 44)
                .add(panelRoundTranslucido1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(panelRoundTranslucido1Layout.createSequentialGroup()
                        .add(samiButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(samiButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jLabel1)
                    .add(jLabel2)
                    .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE)
                    .add(jPasswordField1))
                .addContainerGap(53, Short.MAX_VALUE))
        );
        panelRoundTranslucido1Layout.setVerticalGroup(
            panelRoundTranslucido1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelRoundTranslucido1Layout.createSequentialGroup()
                .add(104, 104, 104)
                .add(jLabel1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel2)
                .add(4, 4, 4)
                .add(jPasswordField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(35, 35, 35)
                .add(panelRoundTranslucido1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(samiButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(samiButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        getContentPane().add(panelRoundTranslucido1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 70, 450, 310));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void samiButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_samiButton2MouseClicked
        this.dispose();
        System.exit(0);
    }//GEN-LAST:event_samiButton2MouseClicked

    private void samiButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_samiButton1MouseClicked
        Menu men=new Menu(this);
        men.setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_samiButton1MouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
     
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new Login().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JTextField jTextField1;
    private org.edisoncor.gui.panel.PanelImage panelImage1;
    private Comun.PanelRoundTranslucido panelRoundTranslucido1;
    private Comun.SamiButton samiButton1;
    private Comun.SamiButton samiButton2;
    // End of variables declaration//GEN-END:variables
}
